val sort = listOf<SortName>(SortName.SELECT,
    SortName.INSERT,
    SortName.MERGE,
    SortName.MERGE_FROM_BELOW,
    SortName.QUICK,
    SortName.QUICK_THREE_WAYS
)

fun <E: Comparable<E>>test(s: List<E>, title: String) {
    val lists = mutableListOf<MutableList<E>>()
    for (i in sort.indices) {
        lists.add(s.toMutableList())
    }
    println("----------$title----------")

    for (i in sort.indices) {
        SortHelper.sortTest(sort[i], lists[i])
    }
}


fun main() {

    test<Int>(ArrayGenerator.generateSortedArray(10000), "有序数组")
    test<Int>(ArrayGenerator.generateRandomArray(10000), "无序数组")
    test<Int>(ArrayGenerator.generateRandomArray(100000), "无序数组")


    println("----------student类----------")
    val students = mutableListOf(Student(79), Student(88), Student(80), Student(77))
    SortHelper.sortTest(SortName.SELECT, students)

}



